-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added geotile grid support #1880
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, this looks good. Could you add a changelog?
There is an other issue we have at the moment with travis and CI is not run. I would like to wait with getting this PR in until we have CI running again if that is ok for you?
sure I will add it there :)
if this will be a week or so sure, no problem. I have switched my project to use fork right now |
It's merged |
src/Aggregation/GeotileGrid.php
Outdated
* | ||
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geotilegrid-aggregation.html | ||
*/ | ||
class GeotileGrid extends AbstractAggregation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, no problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @ruflin for his confirmation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruflin is this ok for you? prefer confirming before doing this changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deguif can you point me to the final comment? I'm not sure I fully follow why we should make it final? Should we really prevent others from extending these classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not mark the class as final for now as it would need discussing this subject more in details.
Will the name GeotileGridAggregation
be OK for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deguif Currently we always skip the Aggregation part as it is already in the name of the directory. So to be consistent it should be GoetileGrid
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but as stated in #1824 I would be in favor to deprecate all aggregations classes and suffix them with Aggregation
to avoid them colliding with reserved keywords and unifying all classes names.
Here's the class is new so it could directly be named accordingly and avoid having to deprecate it later.
Would that sound good for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruflin @deguif please align about it. I really would like it to be merged soon - one way or another ;)
I have added this Aggregation
at the end per request here. I have also changed code in my project to support this new name already.
Btw, I personally like adding Aggregation to the name. Easlier my projects code looked like this
use Elastica\Aggregation\GeotileGrid as GeotileGridAggregation;
for readibility reason later in code. Otherwise it is much less visible in code where it is used that this is aggregation.
62a42c0
to
c05c160
Compare
Thanks @krewetka for your PR. I see on the elasticsearch documentation that there is also an optional |
Yes, it could. But it also exists in geohash grid and is not there in Ruflin elastica so maybe better as separate PR adding it to both? 🤔 |
@krewetka Getting an additional PR later on SGTM. |
c05c160
to
146bb1b
Compare
@deguif after checking this parameter and info that is supports alll formats from https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-bounding-box-query.html#query-dsl-geo-bounding-box-query-accepted-formats I am not sure I am able to handle this one propely. I have checked https://github.com/ruflin/Elastica/blob/a2f5b0d7171691da06a4c31b6829b9c1dafdfbf5/src/Query/GeoBoundingBox.php and even for original one there is just one format supported now in ruflin/Eastica I can try to add the same one type for both Geohash and Geotile but to be honest I don't have time for more, not the knowledge how to do it properly :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Did a commit to resolve the changelog conflict. @deguif If ok for you, please merge directly.
Thanks for merging :) |
In ElasticSearch 7 and above there is new aggregation type which is not supported here yet -> GeoTile Grid
I have added support of it. It is very similar to existing GeoHash Grid except it has more detailed precision levels.
I also renamed one test in other class which had incorrect name.